package com.jenings.shop.service;

import com.jenings.shop.entity.Comment;
import com.jenings.shop.mapper.CommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentService {
    @Autowired
    CommentMapper commentMapper;
    //评论接口
    //查询全部评论
    public List<Comment> selectAll(){
        List<Comment> commentList = commentMapper.selectAll();
        return commentList;
    }
    //查询部分评论，模糊查询
    public List<Comment> selectSome(String plname){
        List<Comment> commentList = commentMapper.selectSome(plname);
        return commentList;
    }
    //查询指定评论
    public Comment selectByte(String plname){
        Comment comment = commentMapper.selectByte(plname);
        return comment;
    }
    //添加评论
    public boolean addByte(Comment comment){
        return commentMapper.addByte(comment);
    }
    //删除评论
    public boolean delByte(Integer plid){
        return commentMapper.delByte(plid);
    }

}
